<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input type="text" value="1" />
    <script>
        //第三题
      let obj = {};
      let input = document.querySelector("input");
      Object.defineProperty(obj, "value", {
        get:  ()=>{
            console.log('获取')
          return bValue;
        },
        set:  (newValue)=>{
            console.log('设置')
          bValue = newValue;
          input.value=newValue;
        },
      });
      input.addEventListener('input',(e)=>{//输入input时间 
        obj.value=e.target.value;
      })
    </script>
  </body>
</html>
